﻿using Liber;
using Liber.BizTools;
using Liber.Message;
using Liber.SOA;
using Liber.API;
using SoBusiness.App;

namespace SoBusiness.API
{
    /// <summary>
    /// 此类提供调用后台应用API的方法，对于必须的步骤进行了简化
    /// </summary>
    public class SoBizAPI:LiberAPI
    {
        SOAHost host;

        public SoBizAPI()
        {
            MsgClnt = InprocClnt.Current;
            host = new SOAHost(MsgClnt); //初始化SOA服务主机
            LiberBizHelper.Ini(host);
            MineApp ma = new MineApp(host);
            RegisterApp rm = new RegisterApp(host);
            PurchaseApp pa = new PurchaseApp(host);
            SaleApp sa = new SaleApp(host);
            CompanyApp ca = new CompanyApp(host);
            host.Begin();
        }

        protected override void DisposeAll()
        {
            host.Stop();
            host.Dispose();
            base.DisposeAll();
        }
    }
}
